home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / os2 / ue311gcc.zip / EMACS.RC < prev    next >
Text File  |  1992-12-29  |  6KB  |  245 lines

  1. ;    EMACS.RC:    Standard micro Startup program
  2. ;            for MicroEMACS 3.9d and above
  3. ;            (C)opyright 1987 by Daniel M Lawrence
  4. ;            Last Update: 10/20/87
  5.  
  6. set $discmd FALSE
  7. write-message "[Setting up....]"
  8.  
  9. ; If you screen "SNOWS", comment this line
  10.     set $flicker "FALSE"
  11.  
  12. ; To use an IBM-PC EGA card, uncomment the following line
  13. ;    set $sres "EGA"
  14.  
  15. ;    Set Default Global modes
  16.  
  17. add-global-mode "blue"
  18. add-global-mode "WHITE"
  19. ;bind-to-key meta-prefix `    ;for annoying keyboards with ` at the top left
  20.  
  21. ;    Toggle function key window display
  22.  
  23. store-procedure    toggle-fkeys
  24.     !if %rcfkeys
  25.         !goto rcfoff
  26.     !endif
  27.  
  28. ;    toggle function key window on
  29.     save-window
  30.     1 next-window
  31.     !if &sequal $cbufname "emacs.hlp"
  32.         delete-window
  33.     !endif
  34.     !if ¬ &sequal $cbufname "Function Keys"
  35.         1 split-current-window
  36.         1 select-buffer "Function Keys"
  37.         add-mode "red"
  38.         !force 5 resize-window
  39.         1 goto-line
  40.     !endif
  41.     set %rcfkeys TRUE
  42.     !force restore-window
  43.     !if &sequal $cbufname "Function Keys"
  44.         next-window
  45.     !endif
  46.     write-message "[Function key window ON]"
  47.     !return
  48.  
  49.     ;Toggle the function key window off
  50. *rcfoff
  51.     save-window
  52.     1 next-window
  53.     !if &sequal "Function Keys" $cbufname
  54.         delete-window
  55.     !endif
  56.     !force restore-window
  57.     write-message "[Function key window OFF]"
  58.     set %rcfkeys FALSE
  59. !endm
  60.  
  61. ;    Bring up Online-help system
  62.  
  63. store-procedure get-help
  64.     set $discmd FALSE
  65.     source ehelp.cmd
  66.     set $discmd TRUE
  67. !endm
  68.  
  69. ;    Load a new page
  70.  
  71. store-procedure get-page-loader
  72.     !if &seq &find newpage.cmd ""
  73.         write-message "[Can not find NEWPAGE.CMD]"
  74.         !return
  75.     !endif
  76.     execute-file newpage.cmd
  77. !endm
  78.  
  79. ;procedure to clean out the current page (which is nothing right now)
  80.  
  81. store-procedure    clean
  82.     ; nothing by default
  83. !endm
  84.  
  85. 7 store-macro
  86.   insert-string ";************************************************************************"
  87.   newline
  88.   insert-string ";*    "
  89.   newline
  90.   insert-string ";************************************************************************"
  91.   newline
  92.   previous-line
  93.   previous-line
  94.   end-of-line
  95. !endm
  96.  
  97. 8 store-macro
  98.   insert-string "/****************************************************************************"
  99.   newline
  100.   insert-string "*    "
  101.   newline
  102.   insert-string "****************************************************************************/"
  103.   newline
  104.   previous-line
  105.   previous-line
  106.   end-of-line
  107. !endm
  108.  
  109. ;    Set up auto CMODE
  110.  
  111. store-procedure set-default-mode
  112.     set %rctmp &sin $cfname "."
  113.     !if &equ %rctmp 0
  114.         !return
  115.     !endif
  116.     set %rctmp &mid $cfname &add %rctmp 1 5
  117.     !if &or &seq %rctmp "c" &seq %rctmp "h"
  118.         add-mode "cmode"
  119.     !endif
  120.     !if &or &seq %rctmp "cpp" &seq %rctmp "hpp"
  121.         add-mode "cmode"
  122.     !endif
  123.     !if &seq %rctmp "tex"
  124.         add-mode "wrap"
  125.     !endif
  126. !endm
  127. set $readhook set-default-mode
  128.  
  129. ;    This function activates the function key window as
  130. ;    a legitimate place to call up function keys using the mouse
  131.  
  132. store-procedure mouse-clicks
  133.  
  134.     ;remember where we started, and do the mouse movement
  135.     save-window
  136.     !force mouse-move-down
  137.  
  138.     ;If not in the function key window... leave
  139.     !if ¬ &sequal $cbufname "Function Keys"
  140.         !return
  141.     !endif
  142.  
  143.     ;First pos is a screen reposition, let it through
  144.     !if &and &equ $xpos 0 &equ $ypos 0
  145.         restore-window
  146.         !return
  147.     !endif
  148.  
  149.     ;Find out what function key were gonna do
  150.     add-mode magic
  151.     2 forward-character
  152.     set %rctmp $search
  153.     !force search-reverse "[fF][0-9]"
  154.     !if &seq $status FALSE
  155.         delete-mode magic
  156.         set $search %rctmp
  157.         !return
  158.     !endif
  159.  
  160.     ;we are on the "f" or "F".  Get the function key type and number now
  161.     set $search %rctmp
  162.     set %fcase lower
  163.     !if &equ $curchar 70
  164.         set %fcase upper
  165.     !endif
  166.     1 forward-character
  167.     set %fnum &chr $curchar
  168.     1 forward-character
  169.     set %fnum &cat %fnum &chr $curchar
  170.     set %fnum &add %fnum 0
  171.     !if &equ %fnum 10
  172.         set %fnum "0"
  173.     !endif
  174.     set %fname &cat "FN" %fnum
  175.     !if &seq %fcase upper
  176.         set %fname &cat "S-" %fname
  177.     !endif
  178.  
  179.     ;save the function
  180.     set %rccmd &bind %fname
  181.     delete-mode MAGIC
  182.  
  183.     ;swallow the up-button
  184.     set %rctmp >c
  185.  
  186.     ;restore the window and exit
  187.     restore-window
  188.  
  189.     ;procedures don't need the square brackets
  190.     !if &seq &left %rccmd 1 "["
  191.         set %rccmd &mid %rccmd 2 &sub &len %rccmd 2
  192.         %rccmd
  193.         !return
  194.     !endif
  195.  
  196.     ;and then execute it
  197.     !force execute-named-command %rccmd
  198. !endm    
  199. macro-to-key mouse-clicks MSa
  200.  
  201. ;    ***** Rebind the Function key group
  202.  
  203. bind-to-key search-forward        FN1
  204. bind-to-key search-reverse        FN2
  205. bind-to-key hunt-forward        FN3
  206. bind-to-key hunt-backward        FN4
  207. macro-to-key toggle-fkeys        FN5
  208. macro-to-key get-help            FN6
  209. bind-to-key next-window            FN7
  210. macro-to-key get-page-loader        FN8
  211. bind-to-key save-file            FN9
  212. bind-to-key exit-emacs            FN0
  213.  
  214. bind-to-key execute-macro-10        S-FN1
  215. bind-to-key execute-macro-11        S-FN2
  216. bind-to-key execute-macro-12        S-FN3
  217. bind-to-key execute-macro-13        S-FN4
  218. bind-to-key execute-macro-14        S-FN5
  219. bind-to-key execute-macro-15        S-FN6
  220. bind-to-key execute-macro-16        S-FN7
  221. bind-to-key execute-macro-17        S-FN8
  222. bind-to-key execute-macro-18        S-FN9
  223. bind-to-key execute-macro-19        S-FN0
  224.  
  225. bind-to-key execute-macro-8 ^]
  226. bind-to-key execute-macro-7 ^\
  227. add-global-mode exact
  228. add-global-mode magic
  229. set $hardtab    4
  230.  
  231. ;    bring up the function key window
  232.  
  233.     1 split-current-window
  234.     select-buffer "Function Keys"
  235.     insert-string "f1 search-> f2 <-search █    MicroEMACS:  Text Editor~n"
  236.     insert-string "f3 hunt->   f4 <-hunt   █ ~n"
  237.     insert-string "f5 fkeys    f6 help     █  Available function key Pages include:~n"
  238.     insert-string "f7 nxt wind f8 pg[    ] █    Word  Box  Emacs  Pascal  C  cObal Lisp~n"
  239.     insert-string "f9 save     f10 exit    █  [use the f8 key to load Pages]~n"
  240.     unmark-buffer
  241.     delete-window
  242.     set %rcfkeys TRUE
  243.     toggle-fkeys
  244.     set $discmd TRUE
  245.